// pages/logistics_detail/index.js
const app = getApp()
const Host = require('../../config').Host
Page({

    /**
     * 页面的初始数据
     */
    data: {
        goods:{},
        express:{},
        list:[],
        orderid:0
    },
call:function(){
    var that=this;
    wx.makePhoneCall({
        phoneNumber: that.data.express.phone,
    })
},
copy:function(){
    var that=this;
    wx.setClipboardData({
        data: that.data.express.number,
        success:function(res){
            wx.getClipboardData({
                success:function(res){
                    wx.showToast({
                        title: '复制成功',
                    })
                },
            })
        },
    })
},
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
      var that=this;
      that.setData({
        orderid: options.id
      })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
      var that=this;
      var orderid = that.data.orderid;
      wx.request({
        url: Host + 'Mine/sendDetail',
        data: { orderid},
        success: function (res) {
          //console.log(res.data);
          if (res.data.code == 200) {
            that.setData({
              goods: res.data.goods,
              express: res.data.express,
              expressnews: res.data.expressnews,
            })
          }
        }
      }) 

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})